<?php

//防止恶意调用
if (!defined('IN_MOD'))
{
    die('Hacking attempt');
}

// 开启MVC框架模式
if($configinfo['mvc'] == 1)
{
	// 开启钩子
	if($configinfo['hookok'] == 1)
	{
		$this->confighook("testconfighook", array("para1"=>"测试参数"));// 测试加载模板钩子
	}
}

// FastXCMS安装信息
if($configinfo['fastxcmsok'] == 1)
{
	// 当前会员
	if(empty($configmember))
	{
		$userid = cmf_get_current_user_id();
		$modulewhere=array();
		$modulewhere["tablename"]='fastxcms_user';
		$modulewhere["dataid"]=$userid;
		$modulewhere["dataidname"]='id';
		$userinfo=modulepara("datainfo",$modulewhere);
		$configmember = $userinfo;
	}
		
	// 导航菜单
	$navMenuModel = new \app\admin\model\NavMenuModel();
	$headmenus = $navMenuModel->navMenusTreeArray(1);
	$footmenus = $navMenuModel->navMenusTreeArray(2);
	$topmenus = $navMenuModel->navMenusTreeArray(3);
	$recmenus = $navMenuModel->navMenusTreeArray(4);
	$this->assign('headmenus', $headmenus);
	$this->assign('footmenus', $footmenus);
	$this->assign('topmenus', $topmenus);
	$this->assign('recmenus', $recmenus);
	
	// 在线客服
	$configcommon['kf'] = $configblock['在线客服']['在线客服'];
	$qqarr = getstrtoarr(",",$configcommon['kf']['qq']);
	foreach($qqarr as $key=>$val)
	{
		$qq = getstrtoarr("|",$val);
		$qqarrs[$key]['qq'] = $qq[0];	
		$qqarrs[$key]['name'] = $qq[1];
	}
	$configcommon['kf']['qqarr'] = $qqarrs;
	$telarr = getstrtoarr(",",$configcommon['kf']['tel']);
	$configcommon['kf']['telarr'] = $telarr;
	
	// 获取栏目参数验证规则
	$configsystem['columnparametercodeqzstr'] = '';
	$configsystem['columnparametercodeqzstrtip'] = '';
	foreach($configinfo['columnparametercodeqz'] as $key=>$val)
	{
		$codeqzarr = getstrtoarr("||",$val);
		$configsystem['columnparametercodeqzstr'] .= $codeqzarr[0].",";
		$configsystem['columnparametercodeqzstrtip'] .= $codeqzarr[1].",";
	}
	
	// 当默认语言为中文时开启设置其它语言样式
	$configcommon['langStyleOther'] = 0;
	if($configinfo['langdefault'] == 'cn' && $lang != 'cn')
	{
		if(iffile(ROOT_PATH."public/themes/simpleboot3/public/assets/css/style_other.css") == 1)
		{
			$configcommon['langStyleOther'] = 1;
		}
	}
	
	// 当前语言配置样式文件是否存在
	$configcommon['langStyleOk'] = 0;
	if(iffile(ROOT_PATH."public/themes/simpleboot3/public/assets/css/style_".$lang.".css") == 1)
	{
		$configcommon['langStyleOk'] = 1;
	}
}
?>